package leetcode.code0105;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;
import leetcode.helper.tree.TreeArray;
import leetcode.helper.tree.TreeNode;

public abstract class Solution105 implements IDebug {
	public abstract TreeNode buildTree(int[] preorder, int[] inorder);

	@Override
	public void debug1() {
		TreeNode r = this.buildTree(HelpDebug.str2array3("[3,9,20,15,7]"), HelpDebug.str2array3("[9,3,15,20,7]"));
		TreeNode e = TreeArray.array2tree(HelpDebug.str2array4("[3,9,20,null,null,15,7]"));
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug2() {
		TreeNode r = this.buildTree(HelpDebug.str2array3("[1,2]"), HelpDebug.str2array3("[2,1]"));
		TreeNode e = TreeArray.array2tree(HelpDebug.str2array4("[1,2]"));
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug3() {
		TreeNode r = this.buildTree(HelpDebug.str2array3("[1,2]"), HelpDebug.str2array3("[1,2]"));
		TreeNode e = TreeArray.array2tree(HelpDebug.str2array4("[1,null,2]"));
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

}
